package www.yingdi365.com.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import www.yingdi365.com.R;
import www.yingdi365.com.base.ZjbBaseNotLeftActivity;

public class HuanYinYeActivity extends ZjbBaseNotLeftActivity {

    private ImageView imgWelcome;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_huan_yin_ye);
        init();
    }

    @Override
    protected void initSP() {

    }

    @Override
    protected void initIntent() {

    }

    @Override
    protected void findID() {
        imgWelcome = (ImageView) findViewById(R.id.imgWelcome);
    }

    @Override
    protected void initViews() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(2000);
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                           toMainActivity();
                        }
                    });
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    @Override
    protected void setListeners() {

    }

    @Override
    protected void initData() {

    }

    private void toMainActivity() {
        Intent intent = new Intent();
        if (isLogin) {
            intent.setClass(HuanYinYeActivity.this, MainActivity.class);
            startActivity(intent);
            finish();
        } else {
            intent.setClass(HuanYinYeActivity.this, DengLuActivity.class);
            startActivity(intent);
            finish();
        }
    }
}
